﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TribesPSO
{
    /// <summary>
    /// A wrapper class for System.Random allowing it to be used as an IRandom object in TribesPSO
    /// </summary>
    public class Random : System.Random,IRandom
    {
        /// <summary>
        /// Creates a new Random object seeded with the system time.
        /// </summary>
        /// <remarks>
        /// This is a thin wrapper around the System.Random() constructor
        /// </remarks>
        public Random() : base() { }

        /// <summary>
        /// Creates a new Random object seeded with the specified value.
        /// </summary>
        /// <param name="seed">A number used to calculate a starting value for the pseudo-random number sequence</param>
        /// <remarks>
        /// This is a thin wrapper around the System.Random(int Seed) constructor
        /// </remarks>
        public Random(int seed) : base(seed) { }

        /// <summary>
        /// Returns a non-negative random number
        /// </summary>
        /// <returns>A 32-bit signed integer greater than or equal to zero and less than MaxValue.</returns>
        /// <remarks>This is a thin wrapper around the System.Random.Next() method</remarks>
        public int NextInt()
        {
            return base.Next();
        }

        /// <summary>
        /// Returns a non-negative random number less than the specified maximum
        /// </summary>
        /// <param name="maxValue">The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to zero.</param>
        /// <returns>A 32-bit signed integer greater than or equal to zero, and less than maxValue; that is, the range of return values ordinarily includes zero but not maxValue. However, if maxValue equals zero, maxValue is returned.</returns>
        /// <remarks>This is a thin wrapper around the System.Random.Next(int maxValue) method</remarks>
        public int NextInt(int maxValue)
        {
            return base.Next(maxValue);
        }

        /// <summary>
        /// Returns a random number within a specified range.
        /// </summary>
        /// <param name="minValue">The inclusive lower bound of the random number returned.</param>
        /// <param name="maxValue">The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue.</param>
        /// <returns>A 32-bit signed integer greater than or equal to minValue and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.</returns>
        /// <remarks>This is a thin wrapper around the System.Random.Next(int minValue, int maxValue) method</remarks>
        public int NextInt(int minValue, int maxValue)
        {
            return base.Next(minValue, maxValue);
        }
    }
}
